Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

239
Visualizações
what is "is" keyword used for in JavaScript?

so i dont understand the logic behind "is" keyword (here "isSleeping") i see lots of time studying javascript.

does it mean something results boolean?

let animal = {
  walk() {
    if (!this.isSleeping) {
      alert(`I walk`);
    }
  },
  sleep() {
    this.isSleeping = true;
  }
};

let rabbit = {
  name: "White Rabbit",
  __proto__: animal
};

// modifies rabbit.isSleeping
rabbit.sleep();

alert(rabbit.isSleeping); 
alert(animal.isSleeping); 

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

"is" is not a keyword it's a way of naming your boolean variables AKA naming convention, so when other people see a variable with "is" in front they know that variable is a boolean.

By @ironmouse The same goes with "has": For example there could be functions like "hasSiblings" or "isMarried" that return a boolean type. However the return type is not set in stone but it is a good convention for developers.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda